#include "Light.h"

//初始化
void Light_Init(){
    P0_MODE_IO_PU(GPIO_Pin_7);
    P5_MODE_IO_PU(GPIO_Pin_2);
	
		Light_off(ALL); //默认灭
}

//开灯
void Light_on(Light temp){
    	// 高电平亮，低电平灭
	if (temp == ALL) {
		LED_LEFT = 1;
		LED_RIGHT = 1;
	} else 	if (temp == LEFT) {
		LED_LEFT = 1;
	} else 	if (temp == RIGHT) {
		LED_RIGHT = 1;
	}
}

//关灯
void Light_off(Light temp){
    	// 高电平亮，低电平灭
	if (temp == ALL) {
		LED_LEFT = 0;
		LED_RIGHT = 0;
	} else 	if (temp == LEFT) {
		LED_LEFT = 0;
	} else 	if (temp == RIGHT) {
		LED_RIGHT = 0;
	}
}